﻿using Domain;
using Domain.Entity;
using Domain.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace Application.AppService.UserRolesAppService
{
	public class UserRolesAppService : IUserRolesAppService
	{
		private readonly IUserRolesRepository userRolesRepository;

		public UserRolesAppService(IUserRolesRepository userRolesRepository)
        {
			this.userRolesRepository = userRolesRepository;
		}

		public Task<List<UserRoleInfo>> GetUsersWithRolesAsync()
		{
			return userRolesRepository.GetUsersWithRolesAsync();
		}

		public Task<UserRoles> SelectUserRolesById(int id)
		{
			return userRolesRepository.SelectUserRolesById(id);
		}

		public Task<bool> UserRolesAdd(UserRoles userRoles)
		{
			return userRolesRepository.UserRolesAdd(userRoles);
		}

		public Task<bool> UserRolesDelete(int id)
		{
			return userRolesRepository.UserRolesDelete(id);
		}

		public UserRolesFenYe UserRolesFenYe(int page, int pageSize)
		{
			return userRolesRepository.UserRolesFenYe(page, pageSize);
		}

		public Task<bool> UserRolesUpdate(UserRoles userRoles)
		{
			return userRolesRepository.UserRolesUpdate(userRoles);
		}
	}
}
